RATFOR-A Preprocessor for a Rational Fortran

نویسنده

  • Brian W. Kernighan
چکیده

Although Fortran is not a pleasant language to use, it does have the advantages of universality and (usually) relative efficiency. The Ratfor language attempts to conceal the main deficiencies of Fortran while retaining its desirable qualities, by providing decent control flow statements: statement grouping if-else and switch for decision-making while, for, do, and repeat-until for looping break and next for controlling loop exits and some ‘‘syntactic sugar’’: free form input (multiple statements/line, automatic continuation) unobtrusive comment convention translation of >, >=, etc., into .GT., .GE., etc. return(expression) statement for functions define statement for symbolic parameters include statement for including source files Ratfor is implemented as a preprocessor which translates this language into Fortran. Once the control flow and cosmetic deficiencies of Fortran are hidden, the resulting language is remarkably pleasant to use. Ratfor programs are markedly easier to write, and to read, and thus easier to debug, maintain and modify than their Fortran equivalents. It is readily possible to write Ratfor programs which are portable to other environments. Ratfor is written in itself in this way, so it is also portable; versions of Ratfor are now running on at least two dozen different types of computers at over five hundred locations. This paper discusses design criteria for a Fortran preprocessor, the Ratfor language and its implementation, and user experience.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

MOUSE4: An Improved Implementation of the RATFOR Preprocessor

RATFOR is a preprocessor language for FORTRAN that supports structured flow of control statements and macro substitution. The RATFOR processor, written in RATFOR, is modular, carefully coded, and portable, but extremely inefficient. A profile of the running time revealed that a linear search in the macro processor consumed over half of the CPU time. Running time was reduced by over 50% when a b...

متن کامل

Variant Translators for Version 9 of Icon

A → B is a popular and effective means of implementing A, given an implementation of B. B is referred to as the target language. Ratfor [1] is perhaps the best known and most widely used example of this technique, although there are many others. In some cases A is a variant of B. An example is Cg [2], a variant of C that includes a generator facility similar to Icon’s [3]. Cg consists of C and ...

متن کامل

Variant Translators for Version 8.10 of Icon

A! B is a popular and effective means of implementing A, given an implementation of B. B is referred to as the target language. Ratfor [1] is perhaps the best known and most widely used example of this technique, although there are many others. In some cases A is a variant of B. An example is Cg [2], a variant of C that includes a generator facility similar to Icon’s [3]. Cg consists of C and s...

متن کامل

BASIC EARTH IMAGING (Version 2.4)

Index 221 CONTENTS Themes The main theme of this book is to take a good quality reflection seismic data set from the Gulf of Mexico and guide you through the basic geophysical data processing steps from raw data to the best-quality final image. Secondary themes are to introduce you (1) to cleaned up but real working Fortran code that does the job, (2) to the concept of " adjoint operator " , an...

متن کامل

Lex ! A Lexical Analyzer Generator

Lex helps write programs whose control flow is directed by instances of regular expressions in the input stream. It is well suited for editor-script type transformations and for segmenting input in preparation for a parsing routine. Lex source is a table of regular expressions and corresponding program fragments. The table is translated to a program which reads an input stream, copying it to an...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Softw., Pract. Exper.

دوره 5  شماره 

صفحات  -

تاریخ انتشار 1975